package com.douban.crawl.db;

import com.douban.crawl.model.MovieComment;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MovieCommentDao {

    private BaseDao baseDao = new BaseDao();

    public void save(MovieComment movieComment) {
        baseDao.insert(movieComment);
    }

    public List<MovieComment> getList(String movieId) {
        Map<String, String> queryMap = new HashMap<>();
        queryMap.put("movie_id", movieId);
        return baseDao.getList(MovieComment.class, queryMap);
    }

    public List<MovieComment> getList(String movieId, Integer limitSize) {
        Map<String, String> queryMap = new HashMap<>();
        queryMap.put("movie_id", movieId);
        return baseDao.getList(MovieComment.class, queryMap, limitSize);
    }
}
